/* client1.c
 *	Simple program to test the network
 *      This is the client 1
 */

#include "syscall.h"


void Print(char* str){
  int c = 0;
  while((str[c] != '\n')){
    c++; 
  }
  c++;
  Write(str,c,ConsoleOutput);
	
}

int main() {
  /*Variable declaration*/
  int lock0, lock1;
  int cond0, cond1;
  int loop;
  int choice;

 

  /***********************/
  /*Start test case 3 ****/
  Print("This is client 3\n");
  Print("***** Start Test 3 ********\n");
  Print("Client3 : CREATE LOCK 1\n");
  lock1 = CreateLock(1); 

  Print("Client3: CREATE CONDITION 1\n");
  cond1 = CreateCondition(1);

  Print("Client3: Lock 1 @ index: \n");
  PrintInt(lock1);
  Print("Client3: Cond 1 @ index: \n");
  PrintInt(cond1);
  
  Acquire(lock1);
  Print("Client 3: Broadcast LOCK 1 CONDITION 1\n");
  Broadcast(lock1,cond1);
 
  Release(lock1);
 
  Exit(0);
}
